﻿
/*----------------------------------------------------------------//
// 文件名：MoTuser.cs
// 文件功能描述：实体 MoTuser.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-25
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTuser
using System;
using System.Data;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTuser
	/// </summary>
	public partial class MoTuser:ICloneable
	{
		#region 表Tuser的字段
		private string uid;
		private string empId;
		private string displayName;
		private string pwd;
		private int status;
		private DateTime createTime;
		private DateTime updateTime;
		private string signaturepic;
		#endregion
		
		#region 构造函数
		public MoTuser()
		{
			     createTime=new DateTime(1900,1,1); updateTime=new DateTime(1900,1,1);   	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTuser(MoTuser item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTuser(string uid,string empId,string displayName,string pwd,int status,DateTime createTime,DateTime updateTime,string signaturepic)
		{
		this.uid=uid;
		this.empId=empId;
		this.displayName=displayName;
		this.pwd=pwd;
		this.status=status;
		this.createTime=createTime;
		this.updateTime=updateTime;
		this.signaturepic=signaturepic;
		}
		#endregion
		
		#region 表Tuser的字段属性
		/// <summary>
		/// UID
		/// </summary>
		public string Uid
		{
			get {return uid;}
			set {uid=value;}
		}
		/// <summary>
		///人员序号是自增序列。人员编码使用触发器实现。 E0001,E0002
		/// </summary>
		public string EmpId
		{
			get {return empId;}
			set {empId=value;}
		}
		/// <summary>
		/// DISPLAY_NAME
		/// </summary>
		public string DisplayName
		{
			get {return displayName;}
			set {displayName=value;}
		}
		/// <summary>
		/// PWD
		/// </summary>
		public string Pwd
		{
			get {return pwd;}
			set {pwd=value;}
		}
		/// <summary>
		///2表示该用户是正常用户，-1表示被删除。0表示被禁用。默认为2.
		/// </summary>
		public int Status
		{
			get {return status;}
			set {status=value;}
		}
		/// <summary>
		/// CREATE_TIME
		/// </summary>
		public DateTime CreateTime
		{
			get {return createTime;}
			set {createTime=value;}
		}
		/// <summary>
		/// UPDATE_TIME
		/// </summary>
		public DateTime UpdateTime
		{
			get {return updateTime;}
			set {updateTime=value;}
		}
		/// <summary>
		/// SIGNATUREPIC
		/// </summary>
		public string Signaturepic
		{
			get {return signaturepic;}
			set {signaturepic=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTuser CopyTo(MoTuser item)
        {
		    item.uid=this.uid;
		    item.empId=this.empId;
		    item.displayName=this.displayName;
		    item.pwd=this.pwd;
		    item.status=this.status;
		    item.createTime=this.createTime;
		    item.updateTime=this.updateTime;
		    item.signaturepic=this.signaturepic;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTuser mo=new MoTuser();
		    mo.Uid=this.Uid;
		    mo.EmpId=this.EmpId;
		    mo.DisplayName=this.DisplayName;
		    mo.Pwd=this.Pwd;
		    mo.Status=this.Status;
		    mo.CreateTime=this.CreateTime;
		    mo.UpdateTime=this.UpdateTime;
		    mo.Signaturepic=this.Signaturepic;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoTuser NewTuser = obj as MoTuser;
                if (NewTuser == null)
                {
                    return false;
                }
                else
                {
				if (NewTuser.Uid==this.Uid && NewTuser.EmpId==this.EmpId && NewTuser.DisplayName==this.DisplayName && NewTuser.Pwd==this.Pwd && NewTuser.Status==this.Status && NewTuser.CreateTime==this.CreateTime && NewTuser.UpdateTime==this.UpdateTime && NewTuser.Signaturepic==this.Signaturepic)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"Uid={0}/EmpId={1}/DisplayName={2}/Pwd={3}/Status={4}/CreateTime={5}/UpdateTime={6}/Signaturepic={7}",uid,empId,displayName,pwd,status,createTime,updateTime,signaturepic);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["UID"]!=null && row["UID"]!=DBNull.Value)
			{
			    this.Uid = (string)row["UID"];
			}
			else
			{
				this.Uid =string.Empty;
			}
		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
			{
			    this.EmpId = (string)row["Emp_ID"];
			}
			else
			{
				this.EmpId =string.Empty;
			}
		    if(row["Display_Name"]!=null && row["Display_Name"]!=DBNull.Value)
			{
			    this.DisplayName = (string)row["Display_Name"];
			}
			else
			{
				this.DisplayName =string.Empty;
			}
		    if(row["PWD"]!=null && row["PWD"]!=DBNull.Value)
			{
			    this.Pwd = (string)row["PWD"];
			}
			else
			{
				this.Pwd =string.Empty;
			}
		    if(row["Status"]!=null && row["Status"]!=DBNull.Value)
			{
			    this.Status = (int)row["Status"];
			}
			else
			{
				this.Status =0;
			}
		    if(row["Create_Time"]!=null && row["Create_Time"]!=DBNull.Value)
			{
			    this.CreateTime = (DateTime)row["Create_Time"];
			}
			else
			{
				this.CreateTime =DateTime.MinValue;
			}
		    if(row["Update_Time"]!=null && row["Update_Time"]!=DBNull.Value)
			{
			    this.UpdateTime = (DateTime)row["Update_Time"];
			}
			else
			{
				this.UpdateTime =DateTime.MinValue;
			}
		    if(row["SignaturePic"]!=null && row["SignaturePic"]!=DBNull.Value)
			{
			    this.Signaturepic = (string)row["SignaturePic"];
			}
			else
			{
				this.Signaturepic =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["UID"] = this.Uid;
			row["Emp_ID"] = this.EmpId;
			row["Display_Name"] = this.DisplayName;
			row["PWD"] = this.Pwd;
			row["Status"] = this.Status;
			row["Create_Time"] = this.CreateTime;
			row["Update_Time"] = this.UpdateTime;
			row["SignaturePic"] = this.Signaturepic;
		}
		#endregion
	}
}
#endregion
